<template>
    <el-form :model="reqData" label-position="left" label-width="0px" class="demo-ruleForm login-container">
        <h3 class="title">代理后台登录</h3>
        <el-form-item prop="account">
            <el-input type="text" v-model="reqData.account" auto-complete="off" placeholder="账号"></el-input>
        </el-form-item>
        <el-form-item prop="checkPass">
            <el-input type="password" v-model="reqData.password" auto-complete="off" placeholder="密码"></el-input>
        </el-form-item>
        <el-form-item prop="checkPass">
            <el-input type="text" v-model="reqData.captcha" auto-complete="off" placeholder="验证码">
                <template slot="append">
                    <img style="height:25px;" v-on:click="codeRandom=Math.random()" :src="figureCode"></template>
            </el-input>
        </el-form-item>
        <!--<el-checkbox v-model="checked" checked class="remember">记住密码</el-checkbox>-->
        <el-form-item style="width:100%;">
            <el-button type="primary" style="width:100%;" @click.native.prevent="login" :loading="logining">登录
            </el-button>
        </el-form-item>
    </el-form>
</template>

<script>
    import Request from "../mixins/Request"

    export default {
        data() {
            return {
                codeRandom: 9426,
                auto_request: false,
                reqData: {
                    account: '',
                    password: ''
                }
            };
        },
    //     computed: {
    //         figureCode(){
    //             return Host.emAdmin + "validation/figure?t=" + this.codeRandom;
    //         },
    //         logining(){
    //             return this.$store.state.loading;
    //         }
    //     },
        mixins: [
            Request
        ],
        methods: {
            login(){
                this.get('demo',{id:1});
                // this.get('login').then(res => {
                //     sessionStorage.setItem('admin', res.data);
                //     this.$router.push({
                //         path: "/member/default_show"
                //     });
                // });
            }
        }
    }
</script>

<style lang="scss" scoped>
    .login-container {
        /*box-shadow: 0 0px 8px 0 rgba(0, 0, 0, 0.06), 0 1px 0px 0 rgba(0, 0, 0, 0.02);*/
        -webkit-border-radius: 5px;
        border-radius: 5px;
        -moz-border-radius: 5px;
        background-clip: padding-box;
        margin: 180px auto;
        width: 350px;
        padding: 35px 35px 15px 35px;
        background: #fff;
        border: 1px solid #eaeaea;
        box-shadow: 0 0 25px #cac6c6;

        .title {
            margin: 0px auto 40px auto;
            text-align: center;
            color: #505458;
        }

        .remember {
            margin: 0px 0px 35px 0px;
        }

    }
</style>